package org.eimac.imacquizz;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;

public class ImacMapActivity extends MapActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.acces);
        
        MapView laMap;
        MapController leControleur;
        double latitude = 48.840146;
        double longitude = 2.586258;

        
        laMap = (MapView)findViewById(R.id.vuemap);
        laMap.setBuiltInZoomControls(true);
        GeoPoint depart = new GeoPoint(microdegrees(latitude),microdegrees(longitude));
        

        
        leControleur = laMap.getController();
        leControleur.setZoom(18);
        leControleur.setCenter(depart);
        
        GestionOverlay objet = new GestionOverlay(getResources().getDrawable(R.drawable.marker));
        objet.addPoint(depart);
        laMap.getOverlays().add(objet);
        
        Button boutonMenu = (Button) findViewById(R.id.menu);
        boutonMenu.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent intent = new Intent();
                setResult(RESULT_OK, intent);
            
                finish();
            }

        });


    }
    
    private int microdegrees(double valeur) {
    	return (int)(valeur*1000000);
    	}


	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
}